﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.DataObject;
using System.Data;
using System.Data.SqlClient;

namespace DataAccess.BusinessObject
{
    public class BEmail:Common.CDBase
    {
        public bool Add(string Email)
        {
            SqlParameter[] sqlParam = { new SqlParameter("@Email",SqlDbType.VarChar)};
            sqlParam[0].Value = Email;
            return RunProcedure("sp_tblEmail_add", sqlParam);
        }
        public bool Delete(string Email)
        {
            SqlParameter[] sqlParam = { new SqlParameter("@Email", SqlDbType.VarChar) };
            sqlParam[0].Value = Email;
            return RunProcedure("sp_tblEmail_delete", sqlParam);
        }
        public IList<OEmail> Get(int PageIndex,int PageSize)
        {
            SqlParameter[] sqlParam = {  new SqlParameter("@PageIndex",SqlDbType.Int),
                                         new SqlParameter("@PageSize",SqlDbType.Int)};            
            return Common.Common.ConvertTo<OEmail>(RunProcedureGet("sp_tblEmail_get", sqlParam));
        }
    }
}
